<template>
  <div>
    <!-- 我是购物车、分类等四个页面的父组件 -->
    <div>top-我的</div>
    <!-- 购物车、分类等四个页面 -->
    <router-view></router-view>
    <div>
      <router-link to="/layout/index?time=2222&id=dhfhsfhh7yui">首页</router-link>
      <router-link :to="{
        path: '/layout/cate',
        query: {
          id: 666,
          name: 777
        }
      }">分类</router-link>
      <router-link to="/layout/car">购物车</router-link>
      <router-link to="/layout/mime">我的</router-link>
      <hr>
      <button @click="changePage('/layout/index')">首页</button>
      <button @click="changePage('/layout/cate')">分类</button>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    changePage(url) {
      this.$router.push({
        path: url,
        query: {
          time: '725555',
          id: '6yujk9uhjkloiu'
        }
      })
    }
  },
};
</script>

<style>
</style>